package com.dy.lock.screen.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.dy.lock.screen.dao.ScoreDao;
import com.dy.lock.screen.pojo.ScoreInfo;
import com.dy.lock.screen.vo.EverydayToday;

@Repository("scoreDao")
public class ScoreDaoImpl extends BaseDaoImpl<ScoreInfo, String> implements
		ScoreDao {

	@Override
	public String getQueryNamespace() {
		return "mybatis.xml.ScoreMapper";
	}

	@Override
	public List<ScoreInfo> queryIncomeBills(String customerId) {
		return getSqlSession().selectList(
				getQueryNamespace() + ".queryIncomeBills", customerId);
	}

	@Override
	public List<ScoreInfo> queryPayBills(String customerId) {
		return getSqlSession().selectList(
				getQueryNamespace() + ".queryPayBills", customerId);
	}

	@Override
	public List<EverydayToday> queryIncomeBillDetail(Map<String, String> paraMap) {
		return getSqlSession().selectList(
				getQueryNamespace() + ".queryIncomeBillDetail", paraMap);
	}

	@Override
	public List<EverydayToday> queryPayBillDetail(Map<String, String> paraMap) {
		return getSqlSession().selectList(
				getQueryNamespace() + ".queryPayBillDetail", paraMap);
	}

	@Override
	public ScoreInfo queryByCustomerId(ScoreInfo scoreInfo) {
		return getSqlSession().selectOne(
				getQueryNamespace() + ".queryByCustomerId", scoreInfo);
	}

	@Override
	public ScoreInfo queryByPrimaryKey(String costomerId) {
		return getSqlSession().selectOne(
				getQueryNamespace() + ".selectByPrimaryKey", costomerId);
	}

	@Override
	public int updateScore(ScoreInfo scoreInfo) {
		return this.getSqlSession().update(
				getQueryNamespace() + ".updateScore", scoreInfo);
	}

}
